from scrapy.cmdline import execute
import sys
import os
import subprocess
'''
在爬虫文件夹下面自定义一个main.py的文件
__file__指的是当前main.py文件
os.path.abspath(__file__)获取当前main.py文件所在路径
os.path.dirname(os.path.abspath(__file__))获取的是当前文件夹的父目录的路径,也就是爬虫文件的目录
execute里面的参数是要调试的爬虫
执行main.py就可以在PyCharm中调试程序了
'''
sys.path.append(os.path.dirname(os.path.abspath('G:\python\scrapy爬取抖音短视频\douyin')))
# t1=subprocess.Popen('taskkill -f -pid 73508',stdout=subprocess.PIPE,shell=True)
# os.system()
# command = "kill 3688"
# t1=subprocess.Popen('kill 810',stdout=subprocess.PIPE,shell=True)
# output = t1.communicate()
# print()
# print(output[0].decode() =='')
# print('123123')
execute(['scrapy', 'crawl', 'douyin1_withkeyword'])
# execute(['scrapy', 'crawl', 'douyin1_userId'])
# https://www.douyin.com/aweme/v1/web/general/search/single/?device_platform=webapp&aid=6383&channel=channel_pc_web&search_channel=aweme_general&sort_type=0&publish_time=0&keyword=lol&search_source=normal_search&query_correct_type=1&is_filter_search=0&offset=0&count=15&version_code=170400&version_name=17.4.0&cookie_enabled=true&screen_width=2560&screen_height=1440&browser_language=zh-CN&browser_platform=Win32&browser_name=Chrome&browser_version=98.0.4758.102&browser_online=true&engine_name=Blink&engine_version=98.0.4758.102&os_name=Windows&os_version=10&cpu_core_num=16&device_memory=8&platform=PC&downlink=10&effective_type=4g&round_trip_time=50&webid=7068592288184518152&msToken=Duob6-fmtHPj4r4dBR4jS8Dj5xht8TEC7yJNwAjI-BBemJooABIenQlLOtX502yAdEEGBt8rsuVGc9khkyblmw5Ep4vcseedKwcivgD8l26bQnT9NaASxg==&X-Bogus=DFSzswVuoQ2ANS3US5VodYXAIQ2c&_signature=_02B4Z6wo00001ttdlXwAAIDDuFdVFLA5C5bbXZHAANTa95gWUZWTRGLpRkCXq2TU5Q9lMCB6TbnVG2dp7JkdlAo2Xzfaek1tPzM8EI9rrmQs43Y2e9V74aICE.FhxRpM0BDTldG244B3IFXY9c
for i in range(10000000000):
    print(i)